﻿                @{
            var tmplId = Guid.NewGuid().ToString();
                    using (var template = Html.Incoding().ScriptTemplate<KeyValueVm>(tmplId))
                    {
                        using (var each = template.ForEach())
                        {
                            @each.Inline(r => r.Selected,
                                         isTrue: @<text>&#9679;&#9679;&#9679;</text>,
                                         isFalse: each.For(r => r.Value))
                        }
                    }
                }
        
        @(Html.When(JqueryBind.InitIncoding)
              .Direct(new[]
                          {
                                  new KeyValueVm
                                      {
                                              Selected = true,
                                              Value = "Yes"
                                      },
                                  new KeyValueVm
                                      {
                                              Selected = false,
                                              Value = "No"
                                      }
                          })
              .OnSuccess(dsl => dsl.Self().Core().Insert.WithTemplateById(tmplId).Html())
              .AsHtmlAttributes()
              .ToDiv())